import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/view/login/index.vue')
  },
  // {
  //   path: '/layout',
  //   name: 'layout',
  //   component: 'view/layout/index.vue',
  //   meta: {
  //     title: '底层layout'
  //   },
  //   children: [
  //     {
  //       path: '/home/my-app',
  //       name: 'MyApp',
  //       component: () => import('@/view/dashboard/myApp.vue')
  //     }
  //   ]
  // },
  {
    path: '/:catchAll(.*)',
    meta: {
      closeTab: true
    },
    component: () => import('@/view/error/index.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
